import 'ress'
import '@/assets/scss/global.scss'
import Vue from 'vue'
import App from './index.vue'

Vue.config.productionTip = false

import { Swipe, SwipeItem } from 'vant'
Vue.use(Swipe).use(SwipeItem)

// @ts-ignore
import { merge } from '@/utils/helper';
import I18n from '@/utils/I18n';
import getReports from '@yolanda-qn/eight-electrodes-report-lib'
import reportLocales from '@yolanda-qn/eight-electrodes-report-lib/dist/locales'
import language from './i18n/language'
// @ts-ignore
import { getUrlQuery } from '@/utils/helper'

// 指标库引入全部语言
getReports.i18n.setLangPack(reportLocales)

let { themeColor = '#82c65a' } = getUrlQuery(window.location.href)
const isHexColor = /^\w{6}$/.test(themeColor)
themeColor = isHexColor ? `#${themeColor}`.replace(/#+/g, '#') : themeColor

//设置主题色
document.body.style.setProperty('--mainColor1', themeColor)

Vue.prototype.i18n = new I18n({
  langPack: merge([{}, language], { mergeStrategy: merge.MERGE_STRATEGY.deep }),
});
new Vue({
  render: h => h(App)
}).$mount('#app')
